package innerdemo1;

class Person{
    public int age;
    public String name;
}
public class OuterClass {
    public int demo1;
    static class InnerClass{
        OuterClass outerClass;
        public InnerClass(OuterClass outerClass){
            this.outerClass=outerClass;
        }
        public void fun(){
            System.out.println(outerClass.demo1);
        }
        public void fun1(){
            class InnerClass1{
                int age=12;
            }
            InnerClass1 innerClass1=new InnerClass1();
            System.out.println(innerClass1.age);
        }
    }


    public static void main(String[] args) {
        new Person(){//匿名内部类
            public void test(){
                System.out.println("hhhhhhh!");
            }
        }.test();
    }
}
